﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Interop;

namespace CCV_WPF
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            //Create and configure your WPF control instance
            Window w = new Window();
            WindowInteropHelper helper = new WindowInteropHelper(w);
            helper.Owner = (IntPtr)_applicationObject.MainWindow.HWnd;
        }

        private void LoadWFUserControl()
        {
            // Initialize a Host Control which allows hosting a windows form control on WPF. Ensure that the WindowsFormIntegration Reference is present.
            System.Windows.Forms.Integration.WindowsFormsHost host =
                new System.Windows.Forms.Integration.WindowsFormsHost();
            // Create an object of your User control.
            MyWebcam uc_webcam = new MyWebcam();
            // Assign MyWebcam control as the host control's child.
            host.Child = uc_webcam;
            // Add the interop host control to the Grid
            // control's collection of child controls.
            this.grid1.Children.Add(host);
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            int i = Convert.ToInt32(textBox1.Text);
            int j = Convert.ToInt32(textBox1.Text);
            int r = i * j;
            textBox3.Text = r.ToString();
        }
    }
}
